import { get, post } from '@/api/axios'
import { type BiuJsonResult } from '@/api/biu-json-result'

export const urlPrefix: string = '/api/execution-engine'

export interface ExecutionEngine {
  id: string
  name: string
  type: string
  createTime: number
  updateTime: number
}

export function doQueryExecutionEngineList() {
  const url = urlPrefix + '/query-list'
  return get<BiuJsonResult<Array<ExecutionEngine>>>(url)
}

export function createExecutionEngine(request: any) {
  const url = urlPrefix + '/create'
  return post<BiuJsonResult<boolean>>(url, request)
}
